{% set pypi_name = 'mistral-lib' %}
{% set upstream_version = upstream_version('2.4.0') %}
{% set source = url_pypi() %}
{% set rpm_release = '1' %}
Name:           {{ py2name() }}
Version:        {{ py2rpmversion() }}
Release:        {{ py2rpmrelease() }}
Summary:        Mistral shared routings and utilities
License:        {{ license('Apache-2.0') }}
Group:          Development/Languages/Python
URL:            https://docs.openstack.org/{{ pypi_name }}
Source0:        {{ source }}
BuildRequires:  openstack-macros
BuildRequires:  {{ py3('eventlet') }}
BuildRequires:  {{ py3('oslo.log') }}
BuildRequires:  {{ py3('oslo.serialization') }}
BuildRequires:  {{ py3('oslotest') }}
BuildRequires:  {{ py3('stestr') }}
BuildRequires:  {{ py3('testtools') }}
BuildRequires:  {{ py3('yaql') }}
BuildArch:      noarch

%description
This library contains data types, exceptions, functions and
utilities common to Mistral, python-mistralclient and mistral-extra
repositories.

This library also contains the public interfaces for 3rd party integration
(e.g. Actions API, YAQL functions API, etc.)

%package -n python3-mistral-lib
Summary:        Mistral shared routings and utilities
Requires:       {{ py3('eventlet') }}
Requires:       {{ py3('oslo.log') }}
Requires:       {{ py3('oslo.serialization') }}
Requires:       {{ py3('pbr') }}
Requires:       {{ py3('yaql') }}

%description -n python3-mistral-lib
This library contains data types, exceptions, functions and
utilities common to Mistral, python-mistralclient and mistral-extra
repositories.

This library also contains the public interfaces for 3rd party integration
(e.g. Actions API, YAQL functions API, etc.)

This package contains the Python 3.x module.

%prep
%autosetup -p1 -n {{ pypi_name }}-%{version}
%py_req_cleanup

%build
%{py3_build}

%install
%{py3_install}

%check
python3 -m stestr.cli run

%files -n python3-mistral-lib
%license LICENSE
%doc README.rst ChangeLog
%{python3_sitelib}/mistral_lib
%{python3_sitelib}/*.egg-info

%changelog
